var options={add:'true',reduce:'false'};

var setAmount = {
	min:0,
	max:99,
	regx:function(value){
		return new RegExp("^[0-9]\\d*$").test(value);
	},
	amount:function(id,type){
		var txt = $(id).text() , num = 0;
		if ( regx(txt) ) {
			num = parseInt(txt);
			if( type == options.add ){
				num++;
			} else {
				num--;
			}
		} else{ //please input the right number
			$(id).val(0);
			$(id).focus();
		};
		return num;
	},
	add:function(id){
		var id = "#number_"+id;
		var num = amount(id,'true');
		if( num >  0 ){
			$(id).text(num);
		} else {
			//商品数量最少为0
			$(id).text(0);
			$(id).focus();
		}
	},
	reduce:function(){
		
	},
	del:function(){
		
	},
	modify:function(){
		
	}
};
